#include "tperson.h"

#include <QDebug>

unsigned TPerson::age()
{
    return m_age;
}

void TPerson::setAge(int value)
{
    if ( value != m_age ) {
        m_age = value;
        emit ageChanged(m_age);
    }
}

void TPerson::incAge()
{
    m_age++;
    emit ageChanged(m_age);
}

TPerson::TPerson(QString aName, QObject *parent) :
    QObject(parent),
    m_name(aName)
{
    m_age = 10;
    m_score = 79;
}

TPerson::~TPerson()
{
    qDebug() << QStringLiteral("TPerson 对象被删除了");
}


